home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / raytrace / radiance / simplerd.lha / simplerad / FinalFTP / WalkT / scene.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-20  |  2.5 KB  |  53 lines

  1. /**********************************************************************/
  2. /* scene.h                                                            */
  3. /*                                                                    */
  4. /* Simple set of structures to support drawing of quad/triangular     */
  5. /* polygons                                                           */
  6. /*                                                                    */
  7. /* Copyright (C) 1992, Bernard Kwok                                   */
  8. /* All rights reserved.                                               */
  9. /* Revision 1.0                                                       */
  10. /* May, 1992                                                          */
  11. /**********************************************************************/
  12. #ifndef SCENE_H
  13. #define SCENE_H
  14.  
  15. #define RGB_SCALE 255.0              /* For scaling to RGB colour    */
  16. #define RGB_ROUND 0.5
  17.  
  18. #define MAX_SPECTRA_SAMPLES 3        /* Spectra                      */
  19. #define MAX_PATCH_VTX 4              /* Max # of vert per poly       */
  20. #define PATCH 0
  21. #define TRIANGLE 1
  22. #define PATCH_ID "patch"
  23. #define TRI_ID "triangle"
  24.  
  25. #define VERY_LARGE    (1e+5)
  26. #define ENLARGE_WORLD (0.6)         /* Amount to enlarge world BV by */
  27.  
  28. typedef struct {
  29.   int id;                           /* Polygon id                    */
  30.   char *name;                       /* Polygon name                  */
  31.   int class;                        /* PATCH or TRIANGLE             */
  32.   double B[MAX_SPECTRA_SAMPLES];    /* Polygon colour                */
  33.   double                            /* Colour at vertices            */
  34.     vtx_B[MAX_PATCH_VTX][MAX_SPECTRA_SAMPLES];
  35.   Vector vertex[MAX_PATCH_VTX];     /* Polygon vertices              */
  36.   Vector normal[MAX_PATCH_VTX];     /* Polygon normals               */
  37.   int numVert;                      /* Numnber of vertices in patch  */
  38. } SPolygon;
  39.  
  40. typedef struct SMeshType {          /* Set of polygons               */
  41.   SPolygon *polys;                  /* polygons in set               */
  42.   int num_polys;                    /* Number of polygons in set     */
  43. } SMesh;
  44.  
  45. typedef struct {                    /* Scene options                 */
  46.   int log;                          /* log execution                 */
  47.   int totpoly;                      /* Total number of polygons in scene */
  48.   BoundingBoxType worldbox;         /* Bounding box around the scene */
  49.   double worldSize;                 /* Worlds radius                 */
  50. } SLogType;
  51.  
  52. #endif /* SCENE_H */
  53.